package test;

import com.sun.org.apache.xpath.internal.objects.XString;

/**
* Created with IntelliJ IDEA.
*Description:
*User:岁亮亮
*Date:2023-12-27
*TIME:14:32
*/
public class j {
    public static void main(String[] args) {
        int a=1;
        System.out.println(!(a==1));//注意!只能用于boolean类型  不能!a
    }
    public static void main7(String[] args) {
        short a=129;
        byte b=(byte)a;
        System.out.println(b);//打印-127  这个跟byte  b=127+2一样;
        System.out.println(a);
        int c=5;
        c*=(int) a+2;
        System.out.println(c);//先a+2后*
    }
    public static void main6(String[] args) {
        System.out.println("\\\"hello\\\"");//   \\打印\    \"打印"
        System.out.println("\\hello\\");
    }
    public static void main5(String[] args) {//运算符
       int a=10;
           a=a++;
        System.out.println(a);//打印10但在vs中打印11;
        int b=5;
        double c=4;
        a+=b;
        System.out.println(a);//说明+=运算符有自己转换的能力
        //a=a+b//会报错因为a是int类型b是double
        a=(int) a+b;
        String n="adb";
        System.out.println(a);
        System.out.println("a+b="+(a+b));
        System.out.println(n+a);
    }
    public static void main4(String[] args) {
        char a='张';
        char b='w';
        System.out.println(a);
        String str="123";
        String str2="abcdef";
        System.out.println(str);
        System.out.println(str2.length());//打印6 java的字符串没有\0结尾
    }
    public static void main3(String[] args) {
        System.out.println(Integer.MAX_VALUE);//integer是包装类型求int的取直范围
        System.out.println(Integer.MIN_VALUE);
        int a=2147483647+2;//-2147483647
        int b=2147483647+1;//-2147483648
        System.out.println(a);
        System.out.println(b);

    }
    public static void main2(String[] args) {
        System.out.println(10/3);//打印3
        System.out.println((float)10/3);//打印3.333333
        System.out.println(10/(float)3);//3.333333
        System.out.println((float)(10/3));//打印3.0
        System.out.println(10%3);//1
        System.out.println(-10%3);//-1
        System.out.println(10%-3);//1
        System.out.println(-10%-3);//-1
        System.out.println(-(10%3));//-1
        System.out.println(11.5%3);//2.5
        //System.out.println(10/0);//异常
    }
    public static void mainInt(String[] args) {
       /* System.out.println('h');
        System.out.println(Short.MAX_VALUE);
        short a=20;
        short f=30;
        short b=(short)(a+f);
        System.out.println(b);
       f=80;
        System.out.println(f);
        int num=20;
        String str=num+"";
        System.out.println(str  +num );
        int a=4;
        int b=9;
        float c=(float)(b/a);
        System.out.println(c);
*/
    }
}
